package gui;

import javax.swing.*;

import java.awt.*;
import java.awt.event.*;


public class ViewCardGUI extends JFrame implements ActionListener
{
        private JLabel jlID, jlOwner, jlPoints;
        private JTextField jtID, jtOwner, jtPoints;
        private JButton ok;
        private JPanel p1, p2;
        private TableOperations to;
        
        public ViewCardGUI()
        {
                setTitle("MDL - View Loyalty Card");
        setSize(300, 400);
        setLocationRelativeTo(null);
        setResizable(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLayout(new GridLayout(2,1));
        
        //Panel 1
        p1 = new JPanel();
        p1.setLayout(new GridLayout(3,2));
        add(p1);
        
        jlID = new JLabel("ID or Name");
        p1.add(jlID);
        
        jtID = new JTextField("");
        p1.add(jtID);
        
        jlOwner = new JLabel("Owner");
        p1.add(jlOwner);
        
        jtOwner = new JTextField("");
        p1.add(jtOwner);
        
        jlPoints = new JLabel("Points");
        p1.add(jlPoints);
        
        jtPoints = new JTextField("");
        p1.add(jtPoints);
        
        //Panel 2
        p2 = new JPanel(new FlowLayout());
        add(p2);
        
        ok = new JButton("OK");
        ok.addActionListener(this);
        p2.add(ok);
        }
        
        public void actionPerformed(ActionEvent e) 
        {
                if(e.getSource() == ok)
                {
                        this.dispose();
                }
        }
        
        public static void main(String args[])
        {
                ViewCardGUI l = new ViewCardGUI();
                l.setVisible(true);
        }

}